package com.shadow.baiqun.delegate.room.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.shadow.core.delegate.ShadowDelegate;

import java.util.List;


/**
 * @author Administrator
 */
public class FragmentAdapter extends FragmentPagerAdapter {
    private String[] mTab = new String[]{"翻包", "检测", "变更"};
    private List<ShadowDelegate> mDelegates;

    public FragmentAdapter(FragmentManager fm, List<ShadowDelegate> delegates) {
        super(fm);
        mDelegates = delegates;
    }

    @Override
    public Fragment getItem(int position) {
        return mDelegates.get(position);
    }

    @Override
    public int getCount() {
        return mTab.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTab[position];
    }
}
